home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 102 / examples / ctrlndc.c < prev    next >
C/C++ Source or Header  |  1987-01-25  |  2KB  |  38 lines

  1. /* Programmer's guide to GEM - 1986 - p.157 -listing 3.1 - CJPurcell Dec'86  */
  2. /* CTRLNDC.C  - MAIN DRIVER for draw_ndc() examples  using Mark Williams C   */
  3. /* to be tested in NDC and/or RC mode with or without GDOS for implications  */
  4. #include <portab.h>                       /* ATARI DOGS & CATS */
  5. #include <osbind.h>                       /* system constants  */
  6. #include <gemdefs.h>                      /* GEM-definition    */
  7. /* #include <obdefs.h>                    / *object definition */
  8.  
  9. WORD contrl[12], intin[128], ptsin[128], intout[128], ptsout[128];
  10.  
  11. #define M_OFF 256
  12. #define NDC_COORDS 0
  13. #define RIGHT_ALIGNED 2
  14. #define BOTTOM_ALIGNED 3
  15.  
  16. VOID main()                           /*         not           GEMAIN()      */
  17. {
  18.         WORD handle, work_in[11], work_out[57];
  19.         WORD ii;
  20.  
  21.         appl_init();                                    /* init AES for call */
  22.         handle = graf_handle( &ii,&ii,&ii,&ii );        /* get screen handle */
  23.         graf_mouse( M_OFF, NULL );                      /* hide mouse        */
  24.         v_clrwk( handle );                              /* clear workstation */
  25.  
  26.         for( ii=0; ii<11; ++ii ) work_in[ii]=1;         /* init work_in array*/
  27.         work_in[10] = NDC_COORDS;                    /* using NDC coordinates*/
  28.         v_opnvwk( work_in, &handle, work_out );      /* open the workstation */
  29.  
  30.         draw_ndc( handle );                          /* do the examp.routine */
  31.  
  32.         vst_alignment( handle,RIGHT_ALIGNED,BOTTOM_ALIGNED,&ii,&ii );
  33.         v_gtext( handle,32767,0,"Press any Key to Continue" );
  34.         evnt_keybd();                                   /* pause for viewing */
  35.         v_clsvwk( handle );                             /* close workstation */
  36.         appl_exit();                                    /* tell AES finished */
  37. }
  38.